/*
 * Copyright (c) 2021-2031, 河北计全科技有限公司 (https://www.jeequan.com & jeequan@126.com).
 * <p>
 * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.gnu.org/licenses/lgpl.html
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.nmgyjt.springboot.entity;

/*
 * 接口返回码
 *
 * @author terrfly
 * @site https://www.jeequan.com
 * @date 2021/5/24 17:07
 */
public enum ApiCodeEnum {

    SUCCESS(0, "SUCCESS"), //请求成功

    CUSTOM_FAIL(9999, "自定义业务异常"),  //自定义业务异常

    SYSTEM_ERROR(10, "系统异常[%s]"),
    PARAMS_ERROR(11, "参数有误[%s]"),
    DB_ERROR(12, "数据库服务异常"),

    SYS_OPERATION_FAIL_CREATE(500, "新增失败"),
    SYS_OPERATION_FAIL_DELETE(5001, "删除失败"),
    SYS_OPERATION_FAIL_UPDATE(5002, "修改失败"),
    SYS_OPERATION_FAIL_NO_PERMISSION(5003, "管理权先为空,请联系主管单位管理员配置管理权限!"),

    CS_BUSINESS_SIGN_ERR(202401, "sign加密不正确!"),
    SYS_OPERATION_FAIL_PWD_WRONG(150401, "账号/登录密码错误,登陆失败!"),
    SYS_OPERATION_FAIL_ADMIN_PHONE_WRONG(150402, "管理员账号不存在,发送验证码失败!"),
    SYS_OPERATION_FAIL_ADMIN_CODE_WRONG(150403, "管理员账号验证码失败!"),

    ;


    private int code;

    private String msg;

    ApiCodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return this.code;
    }

    public String getMsg() {
        return this.msg;
    }
}
